﻿using Abp.Application.Services.Dto;
using Abp.Runtime.Validation;
using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;

namespace NetCore.Dtos
{
    /// <summary>
    /// 基础输入类
    /// </summary>
    [Description("基础输入类")]
    public class InputIdDto<TPrimaryKey> : IEntityDto<TPrimaryKey>, ICustomValidate
    {
        /// <summary>
        /// 主/外键Id必填
        /// </summary>
        [Required, Description("唯一标识")]
        public TPrimaryKey Id { get; set; }

        ///// <summary>
        ///// 名称不必填
        ///// </summary>
        //[Description("名称")]
        //public string Name { get; set; }
        void ICustomValidate.AddValidationErrors(CustomValidationContext context)
        {
        }
    }
    /// <summary>
    /// long类型的输入基类
    /// </summary>
    public class InputIdDto : InputIdDto<int>
    {

    }
    /// <summary>
    /// 可空long类型的输入基类
    /// </summary>
    public class InputIdNullDto : IEntityDto<int?>
    {
        /// <summary>
        /// 可空主键long类型
        /// </summary>
        public int? Id { get; set; }
    }
    /// <summary>
    /// 可空Guid类型的输入基类
    /// </summary>
    public class InputGuidNullDto : IEntityDto<Guid?>
    {
        /// <summary>
        /// 可空主/外键Guid类型
        /// </summary>
        public Guid? Id { get; set; }
    }
}
